package com.drama.outtake.domain.enums;

import com.drama.outtake.MyException;

/**
 * @Author : 李先均
 * @Date 2022/12/21 10:15
 */
public enum OrderStatus {
    created, payed, consented, produced, delivering, delivered, received, refunding, refused, refunded;

    public static String toChinese(OrderStatus status) {
        switch (status) {
            case created -> {
                return "已创建";
            }
            case payed -> {
                return "已支付";
            }
            case consented -> {
                return "已接单";
            }
            case produced -> {
                return "制作完成";
            }
            case delivering -> {
                return "配送中";
            }
            case delivered -> {
                return "已送达";
            }
            case received -> {
                return "已收到";
            }
            case refunded -> {
                return "已退款";
            }
            case refunding -> {
                return "退款中";
            }
            case refused -> {
                return "拒绝退款";
            }
            default -> throw new MyException("未知的status状态");
        }
    }
}
